CSS Syntax
The following CSS syntax is supported.
To use XPath syntax, prefix the
context
value withxpath:
Special tags
Text
all p, li (without p), and td (without p) elements.TextAndHeaders
also include h1 - h7.AnyText
includes any element with text. For example, adiv
with text, e.g.<div>text</div>
.
Tag Selectors
*
all elementsdiv
all div tagsdiv,p
all divs and paragraphsdiv p
paragraphs inside divsdiv > p
all p tags, one level deep in divdiv + p
p tags immediately after divdiv ~ p
p tags preceded by div.classname
all elements with class#idname
element with IDdiv.classname
divs with certain classnamediv#idname
div with certain ID#idname *
all elements inside#idname
Attribute Selectors
a[target]
a tags with the target attribute.a[target="_blank"]
a
tags where thetarget
attribute equals_blank
[title~="chair"]
title element containing a word[class^="chair"]
class starts with chair[class|="chair"]
class starts with the chair word[class*="chair"]
class contains chair[class$="chair"]
class ends with chair[class%="\bchair\b"]
class matches the regex\bchair\b
Pseudo Selectors/Functions
div:empty
element with no childrenp:emptybreaking
empty element with only spaces, but not non-breaking spaces.p:first-of-type
first of some typep:last-of-type
last of some type:not(span)
element that's not a spanp:first-child
first child of its parentp:last-child
last child of its parentp:nth-child(2)
second child of its parentp:nth-child(3n+1)
nth-child (an + b) formulap:nth-last-child(2)
second child from behindp:nth-of-type(2)
second p of its parentp:nth-last-of-type(2)
...from behindp:only-of-type
unique of its parentp:only-child
only child of its parentp:has(br)
element that contains another elementp:contains(text)
element that contains textp:regex('regex')
element that matches the regex (case sensitive)'regex'
.p:iregex('regex')
element that matches the regex (case insensitive)'regex'
.